﻿using Mono.Cecil.Cil;

public class LdVarAstTree : LuaAstTree
{
    public LuaAstTree Var;
    private string _varName;
    public LdVarAstTree(LuaAstTree var)
    {
        this.Var = var;
    }
    public LdVarAstTree(string var)
    {
        this._varName = var;
    }
    public override void WriteTo(ICodeWriter writer)
    {
        if (Var == null)
            writer.Code(_varName);
        else
            Var.WriteTo(writer);
    }
}

